<?php
if(!isset($_SERVER['SERVER_NAME'])){
    $host = $_SERVER['argv'][2];
    $_SERVER['SERVER_NAME'] = $host;
    $_SERVER['HTTP_HOST'] = $host;
}

//测试
if(preg_match('/test/',$_SERVER['HTTP_HOST'])){
    return [
        'class' => 'yii\db\Connection',
        'dsn' => 'mysql:host=127.0.0.1;dbname=email_to_creator;port=3306',
        'username' => 'root',
        'password' => '59d168798949891f',
        'charset' => 'utf8',
    ];
}
//线上
return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=rm-rj9qz0d97an93iq9h.mysql.rds.aliyuncs.com;dbname=email_to_creator;port=3306',
    'username' => 'vikoc_robot',
    'password' => 'YuSZc33E4shF4gQylR7c@#',
    'charset' => 'utf8',
];
